import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn'

import '@/assets/styles/index.scss' // 全局样式
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 所有业务api接口
import pinia from '@/store'
import './permission'

// 注册指令
import plugins from './plugins'
import globalComponent from '@/components/Gou-ui/index'
// 页面中的echarts图表缩放后在控制台就会出现以下提醒
// Passive Event Listeners 就是告诉前页面内的事件监听器内部是否会调用 preventDefault 函数来阻止事件的默认行为，便于优化页面滑动的性能，所以Passive Event Listeners特性当前只支持mousewheel/touch相关事件
import 'default-passive-events'

const app = createApp(App)

app.use(router)
app.use(plugins)
app.mount('#app')
app.use(globalComponent)

// 注册ElementPlus
app.use(ElementPlus, { locale: locale })
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(pinia)